<template>
  <span :class="cla">{{idx+1}} : {{result}} &nbsp;</span>
</template>

<script>
export default {
  name: "flag",
  props: ["idx", "result"],
  computed: {
    cla() {
      if (this.result == "正确") {
        return "right";
      } else if (this.result == "错误") {
        return "error";
      } else {
        return "undo";
      }
    },
  },
};
</script>

<style scoped>
.right {
  color: green;
}
.error {
  color: red;
}
.undo {
  color: #ccc;
}
</style>